package org.example.demo.dao;

import com.kfyang.manualgear.annotation.Dao;
import com.kfyang.manualgear.annotation.crud.*;
import com.kfyang.manualgear.struct.Page;
import com.kfyang.manualgear.struct.PageResult;
import org.example.demo.entity.OrderEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

@Dao(entity = OrderEntity.class)
public interface OrderDao {

    PageResult<OrderEntity> query(@Param("o") OrderEntity order, Page page);

    int updateOrderByName(@Param("o") OrderEntity order, String orderName);


    Optional<OrderEntity> queryForOne(@Param("o") OrderEntity order);

    @Transactional
    int updateInList(List<Integer> list);

    @Transactional
    int deleteById(int id);

    int deleteByIds(List<Integer> ids);

    int insert(OrderEntity entity);

    int insertAll(List<OrderEntity> entityList);

    int update(OrderEntity entity);

    OrderEntity selectById(int id);

    List<OrderEntity> selectAll();
}
